Draft
Conversation
Companion to the Cloudflare Workers + D1 schema + CreditAccount DO in
diggerhq/opencomputer-infra-internal. This is the Go half: Redis Streams
replacing NATS, HMAC-signed event forwarding to the CF events-ingest
Worker, HMAC-authed /admin/halt-org + /admin/resume-org endpoints called
by the CF CreditAccount DO, and a 60s halt_reconciler safety-net pull of
/internal/halt-list from the CF api-edge Worker.
Runs alongside existing PG billing unchanged (CF-parallel mode): the DO
mirrors orgs.free_credits_remaining_cents rather than replacing it, and
halt/resume dispatches are idempotent against the existing hibernate.
Highlights:
- Worker XADDs to events:{cell_id} stream every 2s; CP forwarder drains
via XREADGROUP + XAUTOCLAIM, enriches each envelope with (org_id, plan)
via PG lookup, and ships HMAC-signed batches to the CF ingest Worker.
- cfg.CellID (OPENSANDBOX_CELL_ID, defaults "dev-cell-a") is the new
deployment identifier; cfg.Region retained for AWS/Azure/S3 duties.
Renaming the two fully is deferred to the CF-authoritative cutover.
- usage_collector emits usage_tick events every 60s so CF can aggregate
billing independently of PG.
- NATS fully removed: event_publisher, sync_consumer, controlplane/server.go
(orphaned — no external callers), and nats.go deps gone.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to the Cloudflare Workers + D1 schema + CreditAccount DO in diggerhq/opencomputer-infra-internal. This is the Go half: Redis Streams replacing NATS, HMAC-signed event forwarding to the CF events-ingest Worker, HMAC-authed /admin/halt-org + /admin/resume-org endpoints called by the CF CreditAccount DO, and a 60s halt_reconciler safety-net pull of /internal/halt-list from the CF api-edge Worker.
Runs alongside existing PG billing unchanged (CF-parallel mode): the DO mirrors orgs.free_credits_remaining_cents rather than replacing it, and halt/resume dispatches are idempotent against the existing hibernate.
Highlights: